#! /usr/bin/env python
# -*- coding:utf-8 -*-
# Author Jmz

# 自定义元类
class Mymate(type):
    def __int__(self,class_name,class_bases,class_dict):
        super(Mymate,self).__init__(class_name,class_bases,class_dict)


class student(object,metaclass=Mymate):  # student = Mymate("student",(object,),{类体代码，名称空间})
    def __init__(self,name):
        self.name = name
    def learn(self):
        print('%s learning....'%self.name)

jmz = student('jmz')
jmz.learn()         # jmz learning....
print(student.__dict__)
# {'__module__': '__main__', '__init__': <function student. at 0x00000000024E99D8>, 'learn': <function student.learn at 0x00000000024E9A60>, '__dict__': <attribute '__dict__' of 'student' objects>, '__weakref__': <attribute '__weakref__' of 'student' objects>, '__doc__': None}__init__